Communication apparatus, method for controlling communication apparatus, and computer program

ABSTRACT

A communication apparatus determines whether the communication apparatus is to operate as a transmission apparatus for transmitting service data to be transferred by a service performed via a network, or operate as both the transmission apparatus for transmitting the service data to be transferred by the service performed via the network and a reception apparatus for receiving the service data to be transferred by the service performed via the network, terminates a connection with a communication partner apparatus in response to completion of transmission of the service data if the communication apparatus operates as the transmission apparatus, and terminates the connection with the communication partner apparatus in response to a user operation if the communication apparatus operates as both the transmission apparatus and the reception apparatus.

TECHNICAL FIELD

The present invention relates to a communication apparatus, a method forcontrolling the communication apparatus, and a computer program.

BACKGROUND ART

In recent years, more and more electronic apparatuses, such as digitalcameras or printers, have been equipped with a wireless local areanetwork (LAN) station function and used as communication apparatuses byconnecting to a wireless LAN. For example, Japanese Patent ApplicationLaid-Open No. 2011-35768 discusses a method in which a digital camera isequipped with a wireless LAN function to facilitate image sharing.

Further, a standard called Wi-Fi Direct (registered trademark) isestablished by Wi-Fi Alliance. In Wi-Fi Direct, a protocol fordetermining whether each electronic apparatus operates as either awireless LAN access point or a wireless LAN station is defined. Byimplementing the protocol, which electronic apparatus is to operate asthe wireless LAN access point and which electronic apparatus is tooperate as the wireless LAN station can be automatically determined, sothat user convenience is enhanced.

Further, in Wi-Fi Direct, a function of advertising and searching forservice information supported by a higher-order application (servicediscovery function) is defined as an optional function. The servicediscovery function allows, before executing connection processing, anelectronic apparatus to obtain the service information stored in anelectronic apparatus to be connected thereto. Accordingly, userconvenience is enhanced.

The user can execute wireless LAN connection processing and serviceconnection processing as an operation sequence simply by selecting theservice the user desires to use.

However, various kinds of services are provided via a network, and whena service will end cannot always be identified.

SUMMARY OF INVENTION

The present invention is directed to terminating a connection with acommunication partner apparatus according to a service.

According to an aspect of the present invention, a communicationapparatus includes a transmission means for transmitting service data tobe transferred by a service performed via a network, a reception meansfor receiving the service data to be transferred by the serviceperformed via the network, a determination means for determining whetherthe communication apparatus is to operate as a transmission apparatus ona transmitting side where the service data is transmitted by thetransmission means, or operate as both the transmission apparatus on thetransmitting side where the service data is transmitted by thetransmission means and a reception apparatus on a receiving side wherethe service data is received by the reception means, and a disconnectionmeans for terminating a connection with a communication partnerapparatus, wherein if the communication apparatus operates as thetransmission apparatus, the disconnection means terminates theconnection with the communication partner apparatus in response tocompletion of transmission of the service data, and if the communicationapparatus operates as both the transmission apparatus and the receptionapparatus, the disconnection means terminates the connection with thecommunication partner apparatus in response to a user operation.

According to another aspect of the present invention, a communicationapparatus includes a transmission means for transmitting service data tobe transferred by a service performed via a network, a reception meansfor receiving the service data to be transferred by the serviceperformed via the network, a determination means for determining whetherthe communication apparatus is to operate as a reception apparatus on areceiving side where the service data is received by the receptionmeans, or operate as both a transmission apparatus on a transmittingside where the service data is transmitted by the transmission means andthe reception apparatus on the receiving side where the service data isreceived by the reception means, and a disconnection means forterminating a connection with a communication partner apparatus, whereinif the communication apparatus operates as the reception apparatus, thedisconnection means terminates the connection with the communicationpartner apparatus in response to completion of reception of the servicedata, and if the communication apparatus operates as both thetransmission apparatus and the reception apparatus, the disconnectionmeans terminates the connection with the communication partner apparatusin response to a user operation.

Further features of the present invention will become apparent from thefollowing description of exemplary embodiments with reference to theattached drawings.

BRIEF DESCRIPTION OF DRAWINGS

FIG. 1 is a block diagram of a configuration of a communicationapparatus.

FIG. 2 is a block diagram of software functions in the communicationapparatus.

FIG. 3 illustrates an example of a network configuration according to afirst exemplary embodiment of the present invention.

FIG. 4 is an operation sequence diagram according to the first exemplaryembodiment.

FIG. 5 is another operation sequence diagram according to the firstexemplary embodiment.

FIG. 6 is yet another operation sequence diagram according to the firstexemplary embodiment.

FIG. 7 is a flowchart illustrating operation performed by thecommunication apparatus according to the first exemplary embodiment.

FIG. 8 is an operation sequence diagram according to a second exemplaryembodiment of the present invention.

FIG. 9 is a flowchart illustrating operation performed by thecommunication apparatus according to the second exemplary embodiment.

FIG. 10 is an image diagram illustrating a simultaneously-captured imagesharing service according to the first exemplary embodiment.

DESCRIPTION OF EMBODIMENTS

Various exemplary embodiments, features, and aspects of the inventionwill be described in detail below with reference to the drawings.Although an example will be described below where communicationapparatuses perform wireless communication using the wireless LAN systemdefined by the IEEE 802.11 series of standards, the communication methodto be used is not limited to the wireless LAN conforming to IEEE 802.11.

First, a hardware configuration of a communication apparatus accordingto a first exemplary embodiment of the present invention will bedescribed.

FIG. 1 is a block diagram illustrating an example of a configuration ofeach communication apparatus to be described below according to thefirst exemplary embodiment. A communication apparatus 101 includesvarious units. A control unit 102 controls the entire communicationapparatus 101 by executing a control program stored in a storage unit103. The control unit 102 also controls setting of communicationparameters to be used for communication with other apparatuses. Thestorage unit 103 stores a control program executed by the control unit102 and various types of information such as the communicationparameters. Various operations to be described below are realized by thecontrol unit 102 executing a control program stored in the storage unit103.

A wireless communication unit 104 performs wireless LAN communicationwhich conforms to the IEEE 802.11 series of standards. A display unit105 performs various types of display. The display unit 105 has afunction of outputting visually-recognizable information, such as aliquid crystal display (LCD) or a light-emitting diode (LED), or afunction of outputting audio such as a speaker. The display unit 105 hasa function of outputting at least either visual information or audioinformation. The communication apparatus 101 further includes an antennacontrol unit 107 and an antenna 108. An operation unit 109 is used by auser to perform various inputs to operate the communication apparatus101.

A service providing unit 110 has a function that providesapplication-level service information provided by the communicationapparatus 101. For example, if the communication apparatus 101 is aprinter, the service providing unit 110 provides a printing function,and the communication apparatus 101 prints out document data and imagedata received via the antenna 108 and the wireless communication unit104. Further, if the communication apparatus 101 is a digital camera,the service providing unit 110 provides an imaging function, and theimage captured by the imaging function can be transmitted to anotherapparatus as transmission data. The service providing unit 110 mayprovide both the printing function and the imaging function, or may alsoprovide other functions including a telephone function, a wirelesscommunication function of a third-generation (3G) telephone, a wirelesscommunication function of a GSM (registered trademark) telephone, and anelectronic mail function. Further, the service providing unit 110 mayhave a function that provides time information and position informationto a communication partner apparatus and receives such information fromthe communication partner apparatus using the global positioning system(GPS), a function that enables position information to be added to acaptured image, and a function that enables an image, such as a capturedimage, to be shared among a plurality of apparatuses. The serviceproviding unit 110 can operate as a service providing unit 208 whichprovides a service as well as a service using unit 209 which uses theservice, which will be described below.

FIG. 2 is a block diagram illustrating an example of a configuration ofsoftware functional blocks which execute a communication controlfunction to be described below. Software functional blocks 201 includevarious units. A discovery control unit 202 performs processing forsearching for a communication apparatus that can serve as acommunication partner apparatus, which will be described below.

A Wi-Fi Direct control unit 203 performs control based on a Wi-Fi Directprotocol specification. According to the Wi-Fi Direct specification, acommunication apparatus which serves as a wireless LAN access point iscalled a P2P Group Owner (GO) and a communication apparatus which servesas a wireless LAN station is called a P2P Client (CL). Such roles aredetermined by a protocol for GO Negotiation and are defined by the Wi-FiDirect specification. In the Wi-Fi Direct specification, a networkestablished by a Group Owner is called a P2P group. The network to bedescribed below is a P2P group. A Group Owner provides a Client withcommunication parameters. Then, the Group Owner and the Client areconnected to each other using the communication parameters. Thecommunication parameters include various kinds of wireless communicationparameters for wireless communication conforming to the IEEE 802.11standard. More specifically, the communication parameters includewireless communication parameters necessary to perform wireless LANcommunication, such as a service set identifier (SSID) as a networkidentifier, an encryption method, an encryption key, an authenticationmethod, and an authentication key. Further, the communication parametersinclude an internet protocol (IP) address to be used for communicationon the IP layer. If the communication apparatus 101 operates as a GroupOwner, the wireless communication unit 104 establishes a wirelessnetwork as a Group Owner and a Client is connected to the Group Owner bywireless LAN. The wireless network is established using the networkidentifier, encryption method, encryption key, authentication method,authentication key, and frequency channel that are specified by theGroup Owner. The encryption key to be used for encrypted communicationis determined by encryption key sharing processing which is performed bythe Group Owner and the Client when the Group Owner authenticates theClient for wireless connection. A P2P Group Owner (GO), a P2P Client(CL), and a communication apparatus, which has not yet been given adefined role, are collectively called a P2P device.

A service discovery control unit 204 controls a service discoveryfunction to be described below. The service discovery function allows acommunication apparatus to exchange service information with a partnercommunication apparatus by transmitting and receiving an action framespecified by IEEE 802.11. More specifically, a communication apparatustransmits a Service Discovery (SD) query to a partner communicationapparatus and receives a SD response as a response. Alternatively, thecommunication apparatus receives a SD query from the partnercommunication apparatus and transmits a SD response as a response. Theservice information exchanged between the communication apparatusesincludes protocol information to be used when the apparatuses mutuallyexecute the service communication, and service function information thatindicates the essential and optional functions supported by the service.For example, if the target apparatus is a printer, information onwhether the printer can support two-sided printing, color or monochromeprinting, or format printing can be provided or acquired as the servicefunction information. The examples described above shall not beconstrued as limiting the present invention. These examples are simplygiven to enhance the understanding.

An L3 Service Discovery control unit 205 controls a service discoveryfunction on the network layer (layer 3) of the open systemsinterconnection (OSI) reference model. This service discovery functioncan be executed by using a technique such as Universal Plug and Play(UPnP) (registered trademark) or Bonjour (registered trademark). Apacket reception unit 206 and a packet transmission unit 207 controltransmission and reception of all packets including an upper layercommunication protocol.

The service providing unit 208 provides services on the applicationlayer. The application layer is a service providing layer in the fifthand upper layers of the OSI reference model. Specifically, the serviceproviding unit 208 provides functions such as a printing function, animage streaming function, and a file transfer function. The servicesprovided via a network, which will be described below, are provided bythe service providing unit 208.

The service using unit 209 uses services on the application layer. Theservice using unit 209 uses the services provided by a service providingunit on the application layer of the communication partner apparatus.More specifically, the service using unit 209 controls a function oftransmitting a print product to a print service providing apparatus, afunction of transmitting a moving image to a digital display, and thelike. The services provided via a network to be described below are usedby the service using unit 209.

All the functional blocks are associated with each other software orhardware wise. Further, the above-described functional blocks are usedas an example. A plurality of functional blocks in this example may beconfigured to form one functional block, or a functional block may befurther divided into a plurality of functional blocks.

FIG. 3 illustrates a network A31 (hereinafter referred to as a networkA) which includes a communication apparatus A32 (hereinafter referred toas a STA-A) and a communication apparatus B33 (hereinafter referred toas a STA-B). These apparatuses have the configuration described abovewith reference to FIGS. 1 and 2.

In the first exemplary embodiment, service search processing andconnection processing on the wireless LAN layer, which are performedwhen the STA-A serving as a digital camera executes a service fortransmitting service data via a network, will be described. The STA-Aexecutes a geotag acquisition service, an image transfer service, and asimultaneously-captured image sharing service, and performs connectionprocessing on the wireless LAN layer. The geotag acquisition service isused for acquiring position information and adding the acquired positioninformation to an image. The image transfer service is used fortransferring an image. The simultaneously-captured image sharing serviceis used for sharing an image between apparatuses. If the STA-A uses thegeotag acquisition service, the STA-A is connected to the STA-B servingas a GPS logger by wireless LAN. Further, if the STA-A uses the geotagacquisition service, the STA-A operates as a reception apparatus whichreceives and acquires position information as the service data of thegeotag acquisition service. Furthermore, if the STA-A uses the geotagacquisition service, the STA-B operates as a transmission apparatuswhich transmits position information as the service data.

If the STA-A uses the image transfer service, the STA-A is connected tothe STA-B serving as a cellular phone or a smartphone by wireless LAN.Further, if the STA-A uses the image transfer service, the STA-Aoperates as a transmission apparatus which transmits image data or animage file, which is transmitted as the service data of the imagetransfer service. Furthermore, if the STA-A uses the image transferservice, the STA-B operates as a reception apparatus which receivesimage data or an image file, which is transmitted as the service data ofthe image transfer service.

If the STA-A uses the simultaneously-captured image sharing service, theSTA-A is connected to the STA-B serving as a digital camera by wirelessLAN. Further, if the STA-A uses the simultaneously-captured imagesharing service, the STA-A operates as both a transmission apparatus fortransmitting image data or an image file, which is the service data ofthe simultaneously-captured image sharing service, and a receptionapparatus for receiving the image data or the image file.

FIG. 4 is an operation sequence diagram illustrating the geotagacquisition service as an example of a service on the application layer.

In FIG. 4, the STA-A is a digital camera and the STA-B is a GPS logger.The GPS logger is an apparatus for recording a moving path using theGPS. The STA-A records the shooting date and time each time an image iscaptured. The STA-B records the date and time and the moving path as GPSinformation. When the geotag acquisition service is started by the STA-Aand the STA-B, the STA-A and the STA-B are connected to each other tosynchronize the data, so that geotag information can be added to eachcaptured image. In this context, the geotag information is positioninformation on the latitude and longitude of the shooting location asadditional information of the captured image.

First, the digital camera (STA-A) searches for the GPS logger (STA-B)using the service discovery processing defined by the Wi-Fi Directspecification. Specifically, the STA-A transmits a SD query packet thatspecifies the geotag acquisition service to the STA-B (F401).

Here, it is assumed that the STA-B supports the geotag acquisitionservice specified in the SD query packet transmitted from the STA-A.Thus, the STA-B adds information indicating that the STA-B supports thegeotag acquisition service to a SD response packet, and transmits the SDresponse packet to the STA-A (F402).

Since the service information has been determined in F401 and F402,wireless LAN connection processing is performed (F403). In the wirelessLAN connection processing, a predetermined protocol for determining aGroup Owner and a Client is executed by the control of the Wi-Fi Directcontrol unit 203. As a result of the execution of the protocol, oneapparatus is determined to serve as a Group Owner and the otherapparatus is determined to serve as a Client. Further, the Group Ownerprovides the Client with communication parameters, and the apparatusesare connected to each other by wireless LAN. If the Group Owner hasalready been determined before the connection processing is performed,the Group Owner that has already been operating as a Group Ownerprovides the Client with communication parameters and the apparatusesare connected to each other by wireless LAN. When the connection on thewireless LAN layer has been completed, the geotag acquisition service isexecuted (F404).

The geotag acquisition service allows a camera to obtain a correspondingset of GPS information and time information from a GPS logger based onthe shooting time of the images stored in the camera. More specifically,the service using unit 209 of the STA-A requests the service providingunit 208 of the STA-B to transmit a set of GPS information and timeinformation corresponding to the images. At this time, the service usingunit 209 notifies the service providing unit 208 of the shooting time ofthe images. More specifically, the service using unit 209 provides theservice providing unit 208 with the shooting time of all the imagesstored in the storage unit 103 of the STA-A, or with the shooting timeof an image that does not have GPS information added or an image that isspecified by the user. Then, the service providing unit 208 transmitsthe GPS information corresponding to the provided shooting time to theservice using unit 209.

When the service using unit 209 of the STA-A determines that thecorresponding set of the GPS information and time information has beenobtained, the service using unit 209 instructs the Wi-Fi Direct controlunit 203 to perform wireless LAN disconnection processing to terminatethe wireless LAN connection. Specifically, the STA-A transmits adeauthentication packet to the STA-B (F405). When receiving thedeauthentication packet, the STA-B transmits a deauthentication packetto the STA-A as a response (F406).

FIG. 5 is an operation sequence diagram illustrating the image transferservice as an example of a service on the application layer. In FIG. 5,it is assumed that the STA-A is a digital camera and the STA-B is asmartphone. The STA-A transfers a desired image to the smartphone, sothat an image captured by the digital camera can be used as a wallpaperof the smartphone.

The digital camera (STA-A) searches for a cellular phone or a smartphone(STA-B) using the service discovery processing defined by the Wi-FiDirect specification. Specifically, the STA-A transmits a SD querypacket that specifies the image transfer service to the STA-B (F501).

Since the STA-B supports the image transfer service specified in the SDquery packet transmitted from the STA-A, the STA-B adds informationindicating that the STA-B supports the image transfer service to a SDresponse packet, and transmits the SD response packet to the STA-A(F502).

Since the service information has been determined in F501 and F502,wireless LAN connection processing is performed (F503). In the wirelessLAN connection processing, a predetermined protocol for determining aGroup Owner and a Client is executed by the control of the Wi-Fi Directcontrol unit 203. As a result of the execution of the protocol, oneapparatus is determined to serve as a Group Owner and the otherapparatus is determined to serve as a Client. Further, the Group Ownerprovides the Client with communication parameters, and the apparatusesare connected to each other by wireless LAN. If the Group Owner hasalready been determined before the connection processing is performed,the Group Owner which has already been operating as a Group Ownerprovides the Client with communication parameters and the apparatusesare connected to each other by wireless LAN. When the connection on thewireless LAN layer has been completed, the image transfer service isexecuted (F504).

The image transfer service allows a camera to transfer the image data oran image file stored therein to a partner communication apparatus suchas a smartphone according to a user's instruction. Specifically, theservice using unit 209 of the STA-A transfers image data or an imagefile to the service providing unit 208 of the STA-B. The image data orimage file to be transferred may be a still image or a moving image. Theimage data or image file to be transferred is specified by a useroperation.

When the service using unit 209 of the STA-A determines that transfer ofthe specified image data or image file has been completed, the serviceusing unit 209 instructs the Wi-Fi Direct control unit 203 to performwireless LAN disconnection processing to terminate the wireless LANconnection. Specifically, the STA-A transmits a deauthentication packetto the STA-B (F505). When receiving the deauthentication packet, theSTA-B transmits a deauthentication packet to the STA-A as a response(F506).

FIG. 6 is an operation sequence diagram illustrating thesimultaneously-captured image sharing service as an example of a serviceon the application layer. In FIG. 6, it is assumed that both the STA-Aand the STA-B are digital cameras. The simultaneously-captured imagesharing service allows the STA-A and STA-B to share captured images andobtain multiangle images. During the simultaneously-captured imagesharing service, the STA-A and the STA-B transfer image data or an imagefile which is displayed on the display unit 105 to the apparatus beingan image sharing partner. When the apparatus as an image sharing partnerhas received the displayed image data or the displayed image file, theapparatus displays the received image along with an image being capturedby its image-capture unit. If the apparatus that has received thedisplayed image has already been viewing an image stored in the storageunit 103, the received displayed image is displayed together with theimage being viewed. Further, during the simultaneously-captured imagesharing service, if an image is captured, the STA-A and the STA-B storethe captured image in the storage unit 103 as well as transfer imagedata or an image file of the captured image to the apparatus being animage sharing partner. The apparatus as an image sharing partner thathas received the captured image displays the received captured image onthe display unit 105 for a predetermined period of time. In thesimultaneously-captured image sharing service, since each of theapparatuses (the STA-A and the STA-B) that share the image operates asdescribed above, the STA-A and the STA-B can display the image almostsimultaneously. Further, the captured image can be shared almost at thesame time as when the image has been captured.

FIG. 10 is an image diagram of the above-described example. In thisservice, the remote screen of the display unit 105 of the STA-B isdisplayed on the screen of the display unit of the STA-A. In the firstexemplary embodiment, since the remote screen of the STA-B is displayed,the user of the STA-A can also remotely operate the STA-B via thedisplay unit of the STA-A. For example, the user can click the shutterof the STA-B via the display unit of the STA-A.

In FIG. 6, the digital camera (STA-A) searches for another digitalcamera (STA-B) using the service discovery processing defined by theWi-Fi Direct specification. Specifically, the STA-A transmits a SD querypacket that specifies the image transfer service to the STA-B (F601).Here, it is assumed that the STA-B supports the simultaneously-capturedimage sharing service specified in the SD query packet transmitted fromthe STA-A. Thus, the STA-B adds information indicating that the STA-Bsupports the simultaneously-captured image sharing service to a SDresponse packet, and transmits the SD response packet to the STA-A(F602).

Since the service information has been determined in F601 and F602,wireless LAN connection processing is performed (F603). In the wirelessLAN connection processing, a predetermined protocol for determining aGroup Owner and a Client is executed by the control of the Wi-Fi Directcontrol unit 203. As a result of the execution of the protocol, oneapparatus is determined to serve as a Group Owner and the otherapparatus is determined to serve as a Client. Further, the Group Ownerprovides the Client with communication parameters, and the apparatusesare connected to each other by wireless LAN. If the Group Owner hasalready been determined before the connection processing is performed,the Group Owner which has already been operating as a Group Ownerprovides the Client with communication parameters, and the apparatusesare connected to each other by wireless LAN. When the connection on thewireless LAN layer has been completed, the simultaneously-captured imagesharing service is executed (F604).

The simultaneously-captured image sharing service allows the image dataor image file acquired by capturing an image according to an user'sinstruction to be transferred to a partner communication apparatus suchas a digital camera. Thus, the service using unit 209 of the STA-Acannot identify when the image will be transferred from the serviceproviding unit 208 of the STA-B, which is an image sharing partner ofthe STA-A. Thus, if the service using unit 209 of the STA-A uses thesimultaneously-captured image sharing service, the service using unit209 determines the completion of the service according to the useroperation. Similarly, if the service using unit 209 of the STA-B usesthe simultaneously-captured image sharing service, the service usingunit 209 determines the completion of the service according to the useroperation.

More specifically, if the user issues a service end instruction byoperating the operation unit 109, the service using unit 209 of theSTA-A detects the operation (F605). When the service using unit 209 ofthe STA-A has detected the operation to end the above-described service,the STA-A transmits a deauthentication packet to the STA-B (F606). Whenreceiving the deauthentication packet, the STA-B transmits adeauthentication packet to the STA-A as a response (F607).

Further, the STA-B which has received the deauthentication packetdisplays, on the display unit 105, a message informing the user that thesimultaneously-captured image sharing service has ended and the wirelessLAN has been disconnected (F608).

As described above, according to the service executed on the applicationlayer, whether the disconnection processing is automatically performedafter the service has been completed or is performed according to theuser's instruction is determined.

FIG. 7 is a flowchart illustrating an example of the operation performedby the STA-A described with reference to FIGS. 4, 5, and 6. In stepS701, the user specifies the service to be used. In step S702, thecontrol unit 102 searches for any available partner apparatus thatsupports the specified service. In step S703, the control unit 102determines whether the partner apparatus that supports the specifiedservice has been detected. If such a partner apparatus does not exist(NO in step S703), the processing proceeds to step S710. In step S710,the control unit 102 performs error processing. Then, the processing isended.

On the other hand, in step S703, if the partner apparatus that supportsthe specified service has been detected (YES in step S703), theprocessing proceeds to step S704. In step S704, the control unit 102performs the connection processing on the wireless LAN layer asdescribed above. In step S705, the control unit 102 executes the serviceprocessing on the application layer. Here, if the service type is theimage transfer service, the processing is continued until all the imagedata or all the image files specified by the user have been transferred.If the service type is the geotag acquisition service, the processing iscontinued until all the GPS information as the position informationnecessary for the images stored in the camera has been acquired. In stepS706, the control unit 102 determines whether the service type is thesimultaneously-captured image sharing service. If the service type isthe image transfer service (NO in step S706), the processing proceeds tostep S707. In step S707, the control unit 102 determines whether theservice processing has been completed. If the control unit 102determines that transfer of all the image data or all the image filesspecified by the user has been completed (YES in step S707), theprocessing proceeds to step S709. In step S709, the control unit 102disconnects the wireless LAN, and then the processing is ended. In stepS706, if the service type is the geotag acquisition service (NO in stepS706), the processing proceeds to step S707. In step S707, if thecontrol unit 102 determines that all the GPS information necessary forthe images stored in the camera has been acquired (YES in step S707),the processing proceeds to step S709. In step S709, the control unit 102disconnects the wireless LAN, and then the processing is ended. In stepS708, the control unit 102 determines whether a disconnectioninstruction has been issued by the user. If the control unit 102determines that a disconnection instruction has been issued by the user(YES in step S708), the processing proceeds to step S709. If the controlunit 102 determines that a disconnection instruction has not been issuedby the user (NO in step S708), the processing returns to step S707.Thus, when the image transfer service or the geotag acquisition serviceis performed, if a disconnection instruction has been issued by the userbefore the completion of the service, the wireless LAN is disconnectedand the processing is ended.

In step S706, if the service type is the simultaneously-captured imagesharing service (YES in step S706), the processing proceeds to stepS711. In step S711, the control unit 102 determines whether adisconnection instruction has been issued by the user. If adisconnection instruction has been issued by the user (YES in stepS711), the processing proceeds to step S709. In step S709, the controlunit 102 disconnects the wireless LAN, and then the processing is ended.

On the other hand, in step S711, if a disconnection instruction has notbeen issued by the user (NO in step S711), the control unit 102continues the simultaneously-captured image sharing service.

According to the first exemplary embodiment, if the service has a clearend condition, the wireless LAN disconnection processing can beautomatically performed after the completion of the service. On theother hand, if the service does not have a clear end condition and theend condition is based on the determination of the user, the apparatuswaits for a disconnection instruction or an end instruction from theuser.

The geotag acquisition service, the image transfer service, and thesimultaneously-captured image sharing service are described as examplesof the service according to the first exemplary embodiment. However, theservice is not limited thereto. The geotag acquisition service and theimage transfer service are used as examples of the service having aclear end condition, and the simultaneously-captured image sharingservice is used as an example of the service which is determined to becompleted by the user.

For example, if a Push service is used, the completion of the servicecan be determined when the transmission apparatus for transmitting theservice data determines that transmitting the service data has beencompleted. Further, if a Pull service is used, the completion of theservice can be determined when the reception apparatus for receiving theservice data determines that receiving or acquiring the service data hasbeen completed. Further, the service data is not limited to image dataor an image file of a still image or a moving image, or positioninformation. The service data may be file data of a document file orprint data.

In the first exemplary embodiment, an example has been described, wherewhether to terminate the wireless LAN connection when the service hasbeen completed is determined according to the service type used by thecommunication apparatus. In a second exemplary embodiment of the presentinvention, an example will be described, where instead of specifying theservice type, the transmission/reception direction of service data isspecified for executing the service. A communication apparatus accordingto the second exemplary embodiment also has the configuration describedabove with reference to FIGS. 1 and 2.

FIG. 8 is an example of an operation sequence diagram of a service onthe application layer. In this service, the transfer direction of theservice data is bidirectional.

The STA-A searches for the STA-B using the service discovery processingdefined by the Wi-Fi Direct specification. Specifically, the STA-Atransmits a SD query packet which specifies a service datatransmission/reception capability to the STA-B (F801). In this example,it is assumed that the STA-B supports the service datatransmission/reception capability specified in the SD query packettransmitted from the STA-A. Thus, the STA-B adds information indicatingthat the STA-B supports the service data transmission/receptioncapability to a SD Response packet, and transmits the SD Response packetto the STA-A (F802).

Since the transfer direction of the service data has been determined inF801 and F802, wireless LAN connection processing is performed (F803).In the wireless LAN connection processing, a predetermined protocol fordetermining a Group Owner and a Client is executed by the control of theWi-Fi Direct control unit 203. As a result of the execution of theprotocol, one apparatus is determined to serve as a Group Owner and theother apparatus is determined to serve as a Client. The Group Ownerprovides the Client with communication parameters, and the apparatusesare connected to each other by wireless LAN. Further, if the Group Ownerhas already been determined before the connection processing isperformed, the Group Owner which has already been operating as a GroupOwner provides the Client with communication parameters, and theapparatuses are connected to each other by wireless LAN. When theconnection on the wireless LAN layer has been completed, the service onthe application layer is executed (F804).

If the transfer direction of the service data is bidirectional, thedisconnection processing is executed when the user issues an instructionto end the service by performing an operation. More specifically, theuser issues a service end instruction to the STA-A by operating theoperation unit 109 (F805). Then, the STA-A transmits a deauthenticationpacket to the STA-B (F806). When receiving the deauthentication packet,the STA-B transmits a deauthentication packet to the STA-A as a response(F807). Further, the STA-B which has received the deauthenticationpacket displays, on the display unit 105, a message informing the userthat the service on the application layer has ended and the wireless LANhas been disconnected (F808).

On the other hand, if the transfer direction of the service data of theservice on the application layer is unidirectional, the completion ofthe service can be determined when either the transmission apparatus,which is on the transmitting side of the service data, or the receptionapparatus, which is on the receiving side of the data, determines thecompletion of the data transfer. The communication apparatus that hasdetermined the completion of the service starts the disconnectionprocessing of the wireless LAN. In the second exemplary embodiment,similarly to the first exemplary embodiment, if the service is the imagetransfer service, the service is determined to be completed when theSTA-A, which is a transmission apparatus for transmitting image data oran image file as the service data, has completed transmission of theservice data. If the service is the geotag acquisition service, theservice is determined to be completed when the STA-A, which acquires GPSinformation as the service data, determines that the STA-A has acquiredthe GPS information which the STA-A has requested the STA-B to transmit.

Further, if the service is the simultaneously-captured image sharingservice, both the STA-A and the STA-B serve as service data transmissionapparatus as well as service data reception apparatuses, and thetransfer direction of the service data is determined to bebidirectional.

FIG. 9 is a flowchart illustrating an example of the operation performedby the STA-A described with reference to FIG. 8. In step S901, the userspecifies the transmission/reception direction of the service data.Here, there are three patterns regarding the transmission/receptiondirection of the service data: transmission of the data from the STA-Ato STA-B, transmission of the data from the STA-B to the STA-A (theSTA-A receives the data transmitted from the STA-B), and bidirectionaltransmission/reception of the data between the STA-A and the STA-B.

In step S902, the control unit 102 searches for any available partnerapparatus that supports the specified service transmission/receptiondirection.

In step S903, the control unit 102 determines whether the partnerapparatus that supports the specified service has been detected. If sucha partner apparatus does not exist (NO in step S903), the processingproceeds to step S909. In step S909, the control unit 102 performs errorprocessing. Then, the processing is ended.

On the other hand, in step S903, if the partner apparatus that supportsthe specified service has been detected (YES in step S903), theprocessing proceeds to step S904. In step S904, the control unit 102performs the wireless LAN connection processing. In step S905, thecontrol unit 102 executes the service processing on the applicationlayer. If the service is the image transfer service, the processing iscontinued until transfer of the image data or image file specified bythe user is completed. If the service is the geotag acquisition service,the processing is continued until all the GPS information necessary forthe images stored in the camera is acquired. In other words, theprocessing is continued until transfer of all the service data from theapparatus on the transmitting side to the apparatus on the receivingside is completed.

In step S906, the control unit 102 determines whether the transferdirection of the service data is bidirectional. In this example, if theservice is the image transfer service or the geotag acquisition service,the transfer direction of the service data is unidirectional (NO in stepS906). Therefore, the processing proceeds to step S907. In step S907,the control unit 102 of the STA-A determines whether the serviceprocessing has been completed. If the control unit 102 determines thattransmission or reception of the service data has been completed (YES instep S907), the processing proceeds to step S908. In step S908, thecontrol unit 102 disconnects the wireless LAN, and then the processingis ended. Even when the image transfer service or the geotag acquisitionservice is performed (NO in step S906), if a disconnection instructionhas been issued by the user before the completion of the service (YES instep S911), then in step 908, the wireless LAN is disconnected and theprocessing is ended.

In step S906, if the transmission/reception direction of the servicedata is bidirectional (YES in step S906), the processing proceeds tostep S910. In step S910, the control unit 102 determines whether adisconnection instruction has been issued by the user. If adisconnection instruction has been issued by the user (YES in stepS910), the processing proceeds to step S908. In step S910, if adisconnection instruction has not been issued by the user (NO in stepS910), the control unit 102 continues the service processing on theapplication layer.

As described above, in the second exemplary embodiment, whether thewireless LAN disconnection processing is to be automatically performedafter the completion of the service or whether the apparatus is to waitfor a disconnection instruction or an end instruction from the user canbe autonomously determined according to the transfer direction of theservice data.

Although the geotag acquisition service, the image transfer service, andthe simultaneously-captured image sharing service are described asexamples of the service according to the second exemplary embodiment,the service is not limited thereto. The geotag acquisition service andthe image transfer service are used as examples of the service having aclear end condition. The simultaneously-captured image sharing serviceis used as an example of the service which is determined to be completedby the user.

For example, if a Push service is used, the completion of the servicecan be determined when the transmission apparatus for transmitting theservice data determines that transmission of the service data has beencompleted. Further, if a Pull service is used, the completion of theservice can be determined when the reception apparatus for receiving theservice data determines that receiving or acquiring the service data hasbeen completed. Furthermore, the service data is not limited to imagedata or an image file of a still image or a moving image, or positioninformation. The service data may be file data of a document file orprint data.

As described above, according to each of the above-describedembodiments, if a communication apparatus operates as a service datatransmission apparatus or a service data reception apparatus, aconnection with a communication partner apparatus is terminated inresponse to completion of transmission or reception of the service data.On the other hand, if a communication apparatus operates as both aservice data transmission apparatus and a service data receptionapparatus, a connection with a communication partner apparatus isterminated in response to a user operation. Thus, if a communicationapparatus can identify the end condition for a service in advance, thecommunication apparatus can terminate a connection with a communicationpartner apparatus in response to completion of the service, so thatunnecessary connections can be reduced. Reducing unnecessary connectionscan cut down power consumption. Further, the network resources can beefficiently used. Furthermore, if the end condition for a service cannotbe identified or is difficult to be identified in advance, adisconnection from the communication partner apparatus before completionof the service can be prevented.

Another exemplary embodiment of the present invention will be described.

In the above-described exemplary embodiments, examples using a wirelessLAN conforming to IEEE 802.11 have been described. However, theexemplary embodiments of the present invention can be implemented usingother wireless medium such as wireless universal serial bus (USB),multiband-OFDM alliance (MBOA), Bluetooth (registered trademark), ultrawide band (UWB), and ZigBee. Further, the embodiments of the presentinvention can also be implemented using a wired communication mediumsuch as wired LAN. The UWB includes Wireless USB, Wireless 1394, andWireless Networking (WINET).

Furthermore, in the above-described exemplary embodiments, examplesusing Wi-Fi Direct have been described. However, the exemplaryembodiments of the present invention can be applied to a method where apredetermined protocol for determining whether to serves as a masterunit or a slave unit is performed between apparatuses. Further, theexemplary embodiments can be applied to a method where a predeterminedprotocol for determining whether to serve as a server or a client isperformed between apparatuses, a method for determining a base stationand an apparatus to be connected thereto by wireless LAN, and the like.

The exemplary embodiments of the present invention can also be realizedby a computer program code. In such a case, a storage medium storing aprogram code of software for implementing the functions of theabove-described exemplary embodiments is supplied to a system or anapparatus, and a computer (or central processing unit (CPU) or microprocessing unit (MPU)) in the system or the apparatus reads out andexecutes the program code stored in the storage medium. In this case,the program code read from the storage medium itself implements thefunctions of the above-described exemplary embodiments. Thus, thestorage medium storing the program code is an exemplary embodiment ofthe present invention. As the storage medium for providing the programcode, a flexible disk, a hard disk, an optical disk, a magneto-opticaldisk, a compact disc read-only memory (CD-ROM), a CD recordable (CD-R),a magnetic tape, a non-volatile memory card, a ROM, or a digitalversatile disc (DVD) may be used, for example.

Further, the functions of the above-described exemplary embodiments canbe implemented not only by the computer executing the program code, butalso by an operating system (OS), which runs on the computer, executingsome or all of actual processes based on an instruction of the programcode. Furthermore, the functions of the above-described exemplaryembodiments can be implemented in such a way that the program code readfrom the storage medium is written into a memory provided in an functionexpansion board inserted into the computer or a function expansion unitconnected to the computer, and a CPU provided in the function expansionboard or the function expansion unit performs some or all of actualprocesses based on an instruction of the program code,

According to the exemplary embodiments of the present invention, acommunication apparatus can terminate a connection with a communicationpartner apparatus according to the service used.

Embodiments of the present invention can also be realized by a computerof a system or apparatus that reads out and executes computer executableinstructions recorded on a storage medium (e.g., non-transitorycomputer-readable storage medium) to perform the functions of one ormore of the above-described embodiment(s) of the present invention, andby a method performed by the computer of the system or apparatus by, forexample, reading out and executing the computer executable instructionsfrom the storage medium to perform the functions of one or more of theabove-described embodiment(s). The computer may comprise one or more ofa central processing unit (CPU), micro processing unit (MPU), or othercircuitry, and may include a network of separate computers or separatecomputer processors. The computer executable instructions may beprovided to the computer, for example, from a network or the storagemedium. The storage medium may include, for example, one or more of ahard disk, a random-access memory (RAM), a read only memory (ROM), astorage of distributed computing systems, an optical disk (such as acompact disc (CD), digital versatile disc (DVD), or Blu-ray Disc (BD)(trademark), a flash memory device, a memory card, and the like.

While the present invention has been described with reference toexemplary embodiments, it is to be understood that the invention is notlimited to the disclosed exemplary embodiments. The scope of thefollowing claims is to be accorded the broadest interpretation so as toencompass all such modifications and equivalent structures andfunctions.

This application claims the benefit of Japanese Patent Application No.2013-033419 filed Feb. 22, 2013, which is hereby incorporated byreference herein in its entirety.

The invention claimed is:
 1. A communication apparatus comprising: oneor more computers for causing the apparatus to: determine whether thecommunication apparatus is to operate as a transmission apparatus thattransmits service data to another communication apparatus via a wirelessconnection, or operate as both the transmission apparatus and areception apparatus that receives service data from said anothercommunication apparatus via the wireless connection; and select, basedon a result of the determination, whether to disconnect the wirelessconnection with said another communication apparatus in response tocompletion of transmission of the service data or to disconnect thewireless connection with said another communication apparatus inresponse to a user operation, wherein, in a case where it is determinedthat the communication apparatus is to operate as the transmissionapparatus, the communication apparatus selects to disconnect thewireless connection with said another communication apparatus inresponse to completion of transmission of the service data, and in acase where it is determined that the communication apparatus is tooperate as both the transmission apparatus and the reception apparatus,the communication apparatus selects to disconnect the wirelessconnection with said another communication apparatus in response to theuser operation.
 2. The communication apparatus according to claim 1,wherein if the communication apparatus operates as the transmissionapparatus for transmitting file data as the service data to said anothercommunication apparatus via the wireless connection, the communicationapparatus disconnects the wireless connection with said anothercommunication apparatus in response to completion of transmission of thefile data.
 3. A communication apparatus comprising: one or morecomputers for causing the apparatus to: determine whether thecommunication apparatus is to operate as a reception apparatus thatreceives service data from another communication apparatus via awireless connection, or operate as both the reception apparatus and atransmission apparatus that transmits service data to said anothercommunication apparatus via the wireless connection; and select, basedon a result of the determination, whether to disconnect the wirelessconnection with said another communication apparatus in response tocompletion of reception of the service data or to disconnect thewireless connection with said another communication apparatus inresponse to a user operation, wherein, in a case where it is determinedthat the communication apparatus is to operate as the receptionapparatus, the communication apparatus selects to disconnect thewireless connection with said another communication apparatus inresponse to completion of reception of the service data, and in a casewhere it is determined that the communication apparatus is to operate asboth the transmission apparatus and the reception apparatus, thecommunication apparatus selects to disconnect the wireless connectionwith said another communication apparatus in response to the useroperation.
 4. The communication apparatus according to claim 1, whereinif the communication apparatus operates as both the transmissionapparatus for transmitting file data as the service data to said anothercommunication apparatus and the reception apparatus for receiving filedata from said another communication apparatus, the communicationapparatus disconnects the wireless connection with said anothercommunication apparatus in response to the user operation.
 5. Thecommunication apparatus according to claim 1, wherein if thecommunication apparatus operates as both the transmission apparatus fortransmitting file data as the service data to said another communicationapparatus and the reception apparatus for receiving file data from saidanother communication apparatus, the communication apparatus does notdisconnect the wireless connection with said another communicationapparatus even when transmission of the file data has been completed,and disconnects the wireless connection with said another communicationapparatus in response to the user operation.
 6. The communicationapparatus according to claim 1, wherein if the communication apparatusoperates as both the transmission apparatus for transmitting file dataas the service data to said another communication apparatus and thereception apparatus for receiving file data from said anothercommunication apparatus, the communication apparatus does not disconnectthe wireless connection with said another communication apparatus evenwhen reception of the file data has been completed, and disconnects thewireless connection with said another communication apparatus inresponse to the user operation.
 7. The communication apparatus accordingto claim 1, wherein the service data includes an image file.
 8. Thecommunication apparatus according to claim 1, wherein the service dataincludes position information.
 9. The communication apparatus accordingto claim 1, wherein the service data includes a document file.
 10. Thecommunication apparatus according to claim 1, wherein the communicationapparatus communicates with said another communication apparatusaccording to IEEE 802.11 series standard.
 11. The communicationapparatus according to claim 1, wherein the communication apparatusshares with said another communication apparatus a communicationparameter to be used for the wireless connection with said anothercommunication apparatus.
 12. The communication apparatus according toclaim 11, wherein the communication apparatus performs processing fordetermining whether the communication apparatus is to provide thecommunication parameter to said another communication apparatus or thecommunication apparatus is to receive the communication parameter fromsaid another communication apparatus, by communicating predeterminedsignals with said another communication apparatus, and shares thecommunication parameter with said another communication apparatusaccording to the determined role.
 13. The communication apparatusaccording to claim 3, wherein if the communication apparatus operates asthe reception apparatus for receiving file data as the service data fromsaid another communication apparatus via the wireless connection, thecommunication apparatus disconnects the wireless connection with saidanother communication apparatus in response to completion of receptionof the file data.
 14. A method for controlling a communicationapparatus, the method comprising: determining whether the communicationapparatus is to operate as a transmission apparatus for transmittingservice data to another communication apparatus via a wirelessconnection, or operate as both the transmission apparatus and areception apparatus for receiving service data from said anothercommunication apparatus via the wireless connection; and select, basedon a result of the determination, whether to disconnect the wirelessconnection with said another communication apparatus in response tocompletion of transmission of the service data or to disconnect thewireless connection with said another communication apparatus inresponse to a user operation, wherein, in a case where it is determinedthat the communication apparatus is to operate as the transmissionapparatus, the communication apparatus selects to disconnect thewireless connection with said another communication apparatus inresponse to completion of transmission of the service data, and in acase where it is determined that the communication apparatus is tooperate as both the transmission apparatus and the reception apparatus,the communication apparatus selects to disconnect the wirelessconnection with said another communication apparatus in response to theuser operation.
 15. A method for controlling a communication apparatus,the method comprising: determining whether the communication apparatusis to operate as a reception apparatus for receiving service data fromanother communication apparatus via a wireless connection, or operate asboth the reception apparatus and a transmission apparatus fortransmitting service data to said another communication apparatus viathe wireless connection; and select, based on a result of thedetermination, whether to disconnect the wireless connection with saidanother communication apparatus in response to completion of receptionof the service data or to disconnect the wireless connection with saidanother communication apparatus in response to a user operation,wherein, in a case where it is determined that the communicationapparatus is to operate as the reception apparatus, the communicationapparatus selects to disconnect the wireless connection with saidanother communication apparatus in response to completion of receptionof the service data, and in a case where it is determined that thecommunication apparatus is to operate as both the transmission apparatusand the reception apparatus, the communication apparatus selects todisconnect the wireless connection with said another communicationapparatus in response to the user operation.
 16. A non-transitorycomputer-readable storage medium storing instructions that, whenexecuted, cause a communication apparatus to perform a process, theprocess comprising: determining whether the communication apparatus isto operate as a transmission apparatus for transmitting service data toanother communication apparatus via a wireless connection, or operate asboth the transmission apparatus and a reception apparatus for receivingservice data from said another communication apparatus via the wirelessconnection; and select, based on a result of the determination, whetherto disconnect the wireless connection with said another communicationapparatus in response to completion of transmission of the service dataor to disconnect the wireless connection with said another communicationapparatus in response to a user operation, wherein, in a case where itis determined that the communication apparatus is to operate as thetransmission apparatus, the communication apparatus selects todisconnect the wireless connection with said another communicationapparatus in response to completion of transmission of the service data,and in a case where it is determined that the communication apparatus isto operate as both the transmission apparatus and the receptionapparatus, the communication apparatus selects to disconnect thewireless connection with said another communication apparatus inresponse to the user operation.
 17. A non-transitory computer-readablestorage medium storing instructions that, when executed, cause acommunication apparatus to perform a process, the process comprising:determining whether the communication apparatus is to operate as areception apparatus for receiving service data from anothercommunication apparatus via a wireless connection, or operate as boththe reception apparatus and a transmission apparatus for transmittingservice data to said another communication apparatus via the wirelessconnection; and select, based on a result of the determination, whetherto disconnect the wireless connection with said another communicationapparatus in response to completion of reception of the service data orto disconnect the wireless connection with said another communicationapparatus in response to a user operation, wherein, in a case where itis determined that the communication apparatus is to operate as thereception apparatus, the communication apparatus selects to disconnectthe wireless connection with said another communication apparatus inresponse to completion of reception of the service data, and in a casewhere it is determined that the communication apparatus is to operate asboth the transmission apparatus and the reception apparatus, thecommunication apparatus selects to disconnect the wireless connectionwith said another communication apparatus in response to the useroperation.